//
//  ServiceManager.h
//  Common
//
//  Created by liurongming on 16/4/12.
//  Copyright © 2016年 IT.Bear. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AFNetworking.h"
#import "JSONKit.h"
#import "Common.h"

@interface ServiceManager : NSObject

/**
 * 发送网络请求POST
 * @param strUrl 服务器地址
 * @param dicRequest 请求数据
 * @param dictResponse 响应数据
 */
+ (void)postTrans:(NSString *)strUrl withRequest:(NSDictionary*)dicRequest success:(void (^)(NSDictionary* dictResponse, BOOL result)) success failure:(void(^)(NSError *error)) failure;

//+ (void)postTrans:(NSString *)strUrl withRequest:(NSDictionary*)dicRequest success:(void (^)(NSDictionary* dictResponse)) success failure:(void(^)(NSError *error)) failure;

/**
 * 发送网络请求GET
 * @param strUrl 服务器地址
 * @param dicRequest 请求数据
 * @param dictResponse 响应数据
 */
+ (void)getTrans:(NSString *)strUrl withRequest:(NSDictionary*)dicRequest success:(void (^)(NSDictionary* dictResponse)) success failure:(void(^)(NSError *error)) failure;

/**
 *  上传单个图片
 *
 *  @param image
 *  @param url
 *  @param uploadName
 *  @param dic
 *  @param success
 *  @param failure
 */
+ (void)uploadImage:(UIImage *)image toURL:(NSString *)url withName:(NSString *)uploadName params:(NSDictionary *)dic success:(void(^)(NSDictionary* dictResponse, BOOL result))success failure:(void (^)(id error))failure;

/**
 *  上传多个图片
 *
 *  @param imageArray
 *  @param url
 *  @param uploadName
 *  @param dic
 *  @param success
 *  @param failure    
 */
+ (void)uploadImages:(NSArray *)imageArray toURL:(NSString *)url withName:(NSString *)uploadName params:(NSDictionary *)dic success:(void(^)(id responseObject))success failure:(void (^)(id error))failure;

+ (void)uploadFileWithUrl:(NSString *)url success:(void(^)(NSDictionary* dictResponse, BOOL result))success failure:(void (^)(id error))failure;

@end
